Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Finder Guide /
Chapter 3 - Finder Commands / Command Definitions


Copy

The Copy command is a request to copy an object or objects to a new location. The Finder version is similar to the standard application command described
in the AppleScript Language Guide, except that the Finder's Copy command
must include parameters.

As shown in the syntax definition, put and into are synonyms for copy and to. When you compile a script, put and into are automatically changed to copy and to.

SYNTAX
( copy | put ) expression ( to | into ) referenceToObject
PARAMETERS
expression
The expression whose value is to be copied. If expression is a reference or a list of references, the Finder copies the objects specified by the references.
Class: Any class
referenceToObject
A reference to the object to which to copy expression.
Class: Reference
RESULT
A reference to the copied object or a list of references.

EXAMPLE
This script copies two files and places them in a folder on another disk:

tell application "Finder"   copy {file "Release Notes" of disk "My World", ¬
      file "Report" of disk "My World"} to folder "Backups" of ¬
      startup disk
end tell

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996